// ml:run = $bin < input
#include <iostream>
#include <vector>

struct data { int x, p; };

int n;
std::vector<data> v;

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin >> n; v.resize(n);
    int max = -(1 << 30), p;
    for (int i = 0; i < n; i++) {
        std::cin >> v[i].x;
        v[i].p = i + 1;
        if (v[i].x > max) {
            max = v[i].x;
            p = v[i].p;
        }
    }
    int ai = p - 1;
    int ak = p + 1;
    if (ai == 0) ai = n;
    if (ak == n + 1) ak = 1;
    std::cout << ai << " " << p << " " << ak << "\n";
}

